package com.xinsoft.service.impl;

import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.Header;
import cn.hutool.http.HttpRequest;
import com.alibaba.druid.sql.visitor.functions.If;
import com.alibaba.fastjson.JSON;
import com.xinsoft.common.exception.BDException;
import com.xinsoft.constant.Const;
import com.xinsoft.entity.dto.*;
import com.xinsoft.entity.po.*;
import com.xinsoft.entity.dto.KisHeadAndBodyVO;
import com.xinsoft.entity.dto.KisApiResultVOS;
import com.xinsoft.service.*;
import com.xinsoft.utils.RedisUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * k8基础信息同步
 */
@Slf4j
@Service
public class SyncBasicKisServiceImpl implements SyncBasicService {

    @Resource
    private RedisUtil redisUtil;
    
    
    @Override
    public List<SysMaterial> materielSync() {
        HashMap<String, Object> paramMap = new HashMap<>();
        paramMap.put("PageSize", "250");
        paramMap.put("Filter", "");
        paramMap.put("ItemClassId", "4");
        paramMap.put("PageNo", "1");
        paramMap.put("Acct", "XRTEST");
        paramMap.put("QueryFields", "FItemId,FName,FNumber,FHelpCode,FModel,FAuxClassID,FAuxClassID_FName,FErpClsID_FName,FErpClsID,FTypeID,FTypeID_FName,FUnitID,FUnitID_FName,FSecInv,FUseState,FUseState_FName,FSecUnitID_FName,FSecUnitID,FSecCoefficient,FDefaultLoc,FDefaultLoc_FName,FSPID_FFullName,FSPID,FLowLimit,FHighLimit");
        KisApiResultVOS kisApiResultVOS = postRequest(redisUtil.get(Const.ERP_CONNECT_URL).toString() + "/api/ItemData", paramMap);
        String datas = kisApiResultVOS.getDatas();
        List<KisMaterielDto> kisMaterielDtos = JSON.parseArray(datas, KisMaterielDto.class);
        List<SysMaterial> sysMaterials = kisMaterielDtos.stream().map(item -> item.voToPo(item)).collect(Collectors.toList());
        return sysMaterials;
    }

    @Override
    public List<SysDictionary> unitSync() {
        HashMap<String, Object> paramMap = new HashMap<>();
        paramMap.put("PageSize", "1000");
        paramMap.put("Filter", "");
        paramMap.put("ItemClassId", "100");
        paramMap.put("PageNo", "1");
        paramMap.put("Acct", "XRTEST");
        paramMap.put("QueryType", "0");
        paramMap.put("QueryFields", "FMeasureUnitId,FUnitGroupID ,FUnitGroupID_FName,FNumber ,FName,FCoefficient,FStandard,FAuxClass,FConversation,FPrecision");
        KisApiResultVOS kisApiResultVOS = postRequest(redisUtil.get(Const.ERP_CONNECT_URL).toString() + "/api/BaseData", paramMap);
        String datas = kisApiResultVOS.getDatas();
        List<KisUnitDto> kisMaterielDtos = JSON.parseArray(datas, KisUnitDto.class);
        List<SysDictionary> sysDictionaries = kisMaterielDtos.stream().map(item -> item.voToPo(item)).collect(Collectors.toList());
        return sysDictionaries;
    }

    @Override
    public Pair<List<MesBom>, List<MesBomDetail>> bomSync() {
        HashMap<String, Object> paramMap = new HashMap<>();
        paramMap.put("Filter", " ");
        paramMap.put("ItemClassId", "50");
        paramMap.put("Acct", "XRTEST");
        KisApiResultVOS kisApiResultVOS = postRequest(redisUtil.get(Const.ERP_CONNECT_URL).toString() + "/api/BillData", paramMap);
        String datas = kisApiResultVOS.getDatas();
        List<KisHeadAndBodyVO> kisHeadAndBodyVO = JSON.parseArray(datas, KisHeadAndBodyVO.class);
        List<BomHeadDto> headDtos = new ArrayList<>();
        List<BomBodyDto> bodyDtos = new ArrayList<>();
        for (KisHeadAndBodyVO vo : kisHeadAndBodyVO) {
            String billHead = vo.getBillHead();
            String billEntry = vo.getBillEntry();
            if (StringUtils.isNotBlank(billHead)) {
                BomHeadDto bomHeadVO = JSON.parseObject(JSON.parse(billHead).toString(), BomHeadDto.class);
                headDtos.add(bomHeadVO);
            }
            if (StringUtils.isNotBlank(billEntry)) {
                List<BomBodyDto> bomBodyVO = JSON.parseArray(billEntry, BomBodyDto.class);
                bodyDtos.addAll(bomBodyVO);
            }
        }
        List<MesBom> mesBoms = headDtos.stream().map(item -> item.voToPo(item)).collect(Collectors.toList());
        List<MesBomDetail> mesBomDetails = bodyDtos.stream().map(item -> item.voToPo(item)).collect(Collectors.toList());

        // todo mesBomDetails.setId()
        Pair<List<MesBom>, List<MesBomDetail>> bomPair = Pair.of(mesBoms, mesBomDetails);
        return bomPair;
    }


    public static void main(String[] args) {
        String str = "{\"status\":\"0\",\"msg\":\"ok\",\"datas\":[{\"FRECORDS\":1,\"FItemId\":12135,\"FNumber\":\"24\",\"FName\":\"新成品库\",\"FParentId\":0,\"FEmpID\":0,\"FEmpID_FName\":\"*\",\"FAddress\":null,\"FProperty\":0,\"FProperty_FName\":null,\"FTypeID\":500,\"FTypeID_FName\":\"普通仓\",\"FSPGroupID\":30,\"FSPGroupID_FName\":\"成品库仓位\"},{\"FRECORDS\":2,\"FItemId\":12134,\"FNumber\":\"23\",\"FName\":\"新原料库\",\"FParentId\":0,\"FEmpID\":0,\"FEmpID_FName\":\"*\",\"FAddress\":null,\"FProperty\":0,\"FProperty_FName\":null,\"FTypeID\":500,\"FTypeID_FName\":\"普通仓\",\"FSPGroupID\":29,\"FSPGroupID_FName\":\"新原材料\"},{\"FRECORDS\":3,\"FItemId\":12057,\"FNumber\":\"21\",\"FName\":\"科微\",\"FParentId\":0,\"FEmpID\":0,\"FEmpID_FName\":\"*\",\"FAddress\":null,\"FProperty\":0,\"FProperty_FName\":null,\"FTypeID\":500,\"FTypeID_FName\":\"普通仓\",\"FSPGroupID\":0,\"FSPGroupID_FName\":\"*\"},{\"FRECORDS\":4,\"FItemId\":11940,\"FNumber\":\"20\",\"FName\":\"金来\",\"FParentId\":0,\"FEmpID\":0,\"FEmpID_FName\":\"*\",\"FAddress\":null,\"FProperty\":0,\"FProperty_FName\":null,\"FTypeID\":500,\"FTypeID_FName\":\"普通仓\",\"FSPGroupID\":0,\"FSPGroupID_FName\":\"*\"},{\"FRECORDS\":5,\"FItemId\":11937,\"FNumber\":\"19\",\"FName\":\"晟彬\",\"FParentId\":0,\"FEmpID\":0,\"FEmpID_FName\":\"*\",\"FAddress\":null,\"FProperty\":0,\"FProperty_FName\":null,\"FTypeID\":500,\"FTypeID_FName\":\"普通仓\",\"FSPGroupID\":0,\"FSPGroupID_FName\":\"*\"},{\"FRECORDS\":6,\"FItemId\":11860,\"FNumber\":\"18\",\"FName\":\"佑宸\",\"FParentId\":0,\"FEmpID\":0,\"FEmpID_FName\":\"*\",\"FAddress\":null,\"FProperty\":0,\"FProperty_FName\":null,\"FTypeID\":500,\"FTypeID_FName\":\"普通仓\",\"FSPGroupID\":0,\"FSPGroupID_FName\":\"*\"},{\"FRECORDS\":7,\"FItemId\":11847,\"FNumber\":\"17\",\"FName\":\"科宇\",\"FParentId\":0,\"FEmpID\":0,\"FEmpID_FName\":\"*\",\"FAddress\":null,\"FProperty\":0,\"FProperty_FName\":null,\"FTypeID\":500,\"FTypeID_FName\":\"普通仓\",\"FSPGroupID\":0,\"FSPGroupID_FName\":\"*\"},{\"FRECORDS\":8,\"FItemId\":11846,\"FNumber\":\"16\",\"FName\":\"贵来登\",\"FParentId\":0,\"FEmpID\":0,\"FEmpID_FName\":\"*\",\"FAddress\":null,\"FProperty\":0,\"FProperty_FName\":null,\"FTypeID\":500,\"FTypeID_FName\":\"普通仓\",\"FSPGroupID\":0,\"FSPGroupID_FName\":\"*\"},{\"FRECORDS\":9,\"FItemId\":11577,\"FNumber\":\"15\",\"FName\":\"翠云电子仓库\",\"FParentId\":0,\"FEmpID\":0,\"FEmpID_FName\":\"*\",\"FAddress\":null,\"FProperty\":0,\"FProperty_FName\":null,\"FTypeID\":500,\"FTypeID_FName\":\"普通仓\",\"FSPGroupID\":0,\"FSPGroupID_FName\":\"*\"},{\"FRECORDS\":10,\"FItemId\":11564,\"FNumber\":\"14\",\"FName\":\"明创仓库\",\"FParentId\":0,\"FEmpID\":0,\"FEmpID_FName\":\"*\",\"FAddress\":null,\"FProperty\":10,\"FProperty_FName\":\"良品\",\"FTypeID\":500,\"FTypeID_FName\":\"普通仓\",\"FSPGroupID\":0,\"FSPGroupID_FName\":\"*\"},{\"FRECORDS\":11,\"FItemId\":11532,\"FNumber\":\"13\",\"FName\":\"南京第四机床厂\",\"FParentId\":0,\"FEmpID\":0,\"FEmpID_FName\":\"*\",\"FAddress\":null,\"FProperty\":0,\"FProperty_FName\":null,\"FTypeID\":500,\"FTypeID_FName\":\"普通仓\",\"FSPGroupID\":0,\"FSPGroupID_FName\":\"*\"},{\"FRECORDS\":12,\"FItemId\":11531,\"FNumber\":\"12\",\"FName\":\"亚盟仓库\",\"FParentId\":0,\"FEmpID\":0,\"FEmpID_FName\":\"*\",\"FAddress\":null,\"FProperty\":0,\"FProperty_FName\":null,\"FTypeID\":500,\"FTypeID_FName\":\"普通仓\",\"FSPGroupID\":0,\"FSPGroupID_FName\":\"*\"},{\"FRECORDS\":13,\"FItemId\":11450,\"FNumber\":\"11\",\"FName\":\"新辉仓库\",\"FParentId\":0,\"FEmpID\":0,\"FEmpID_FName\":\"*\",\"FAddress\":null,\"FProperty\":0,\"FProperty_FName\":null,\"FTypeID\":500,\"FTypeID_FName\":\"普通仓\",\"FSPGroupID\":0,\"FSPGroupID_FName\":\"*\"},{\"FRECORDS\":14,\"FItemId\":10985,\"FNumber\":\"10\",\"FName\":\"报废仓\",\"FParentId\":0,\"FEmpID\":0,\"FEmpID_FName\":\"*\",\"FAddress\":null,\"FProperty\":12,\"FProperty_FName\":\"不良品\",\"FTypeID\":500,\"FTypeID_FName\":\"普通仓\",\"FSPGroupID\":0,\"FSPGroupID_FName\":\"*\"},{\"FRECORDS\":15,\"FItemId\":10930,\"FNumber\":\"09\",\"FName\":\"原材料\",\"FParentId\":0,\"FEmpID\":0,\"FEmpID_FName\":\"*\",\"FAddress\":null,\"FProperty\":10,\"FProperty_FName\":\"良品\",\"FTypeID\":500,\"FTypeID_FName\":\"普通仓\",\"FSPGroupID\":1,\"FSPGroupID_FName\":\"原材料\"},{\"FRECORDS\":16,\"FItemId\":10929,\"FNumber\":\"08\",\"FName\":\"技术样品\",\"FParentId\":0,\"FEmpID\":0,\"FEmpID_FName\":\"*\",\"FAddress\":null,\"FProperty\":0,\"FProperty_FName\":null,\"FTypeID\":500,\"FTypeID_FName\":\"普通仓\",\"FSPGroupID\":0,\"FSPGroupID_FName\":\"*\"},{\"FRECORDS\":17,\"FItemId\":9359,\"FNumber\":\"07\",\"FName\":\"亚盟仓库\",\"FParentId\":0,\"FEmpID\":0,\"FEmpID_FName\":\"*\",\"FAddress\":null,\"FProperty\":0,\"FProperty_FName\":null,\"FTypeID\":500,\"FTypeID_FName\":\"普通仓\",\"FSPGroupID\":0,\"FSPGroupID_FName\":\"*\"},{\"FRECORDS\":18,\"FItemId\":5495,\"FNumber\":\"06\",\"FName\":\"斯凯菲尔(禁用)\",\"FParentId\":0,\"FEmpID\":0,\"FEmpID_FName\":\"*\",\"FAddress\":null,\"FProperty\":12,\"FProperty_FName\":\"不良品\",\"FTypeID\":500,\"FTypeID_FName\":\"普通仓\",\"FSPGroupID\":0,\"FSPGroupID_FName\":\"*\"},{\"FRECORDS\":19,\"FItemId\":5440,\"FNumber\":\"05\",\"FName\":\"成品备货区（禁用）\",\"FParentId\":0,\"FEmpID\":0,\"FEmpID_FName\":\"*\",\"FAddress\":null,\"FProperty\":12,\"FProperty_FName\":\"不良品\",\"FTypeID\":500,\"FTypeID_FName\":\"普通仓\",\"FSPGroupID\":0,\"FSPGroupID_FName\":\"*\"},{\"FRECORDS\":20,\"FItemId\":4071,\"FNumber\":\"04\",\"FName\":\"车间现场\",\"FParentId\":0,\"FEmpID\":0,\"FEmpID_FName\":\"*\",\"FAddress\":null,\"FProperty\":10,\"FProperty_FName\":\"良品\",\"FTypeID\":500,\"FTypeID_FName\":\"普通仓\",\"FSPGroupID\":0,\"FSPGroupID_FName\":\"*\"},{\"FRECORDS\":21,\"FItemId\":407,\"FNumber\":\"03\",\"FName\":\"不良品\",\"FParentId\":0,\"FEmpID\":0,\"FEmpID_FName\":\"*\",\"FAddress\":null,\"FProperty\":0,\"FProperty_FName\":null,\"FTypeID\":500,\"FTypeID_FName\":\"普通仓\",\"FSPGroupID\":0,\"FSPGroupID_FName\":\"*\"},{\"FRECORDS\":22,\"FItemId\":406,\"FNumber\":\"02\",\"FName\":\"成品\",\"FParentId\":0,\"FEmpID\":0,\"FEmpID_FName\":\"*\",\"FAddress\":null,\"FProperty\":0,\"FProperty_FName\":null,\"FTypeID\":500,\"FTypeID_FName\":\"普通仓\",\"FSPGroupID\":0,\"FSPGroupID_FName\":\"*\"},{\"FRECORDS\":23,\"FItemId\":405,\"FNumber\":\"01\",\"FName\":\"材料\",\"FParentId\":0,\"FEmpID\":0,\"FEmpID_FName\":\"*\",\"FAddress\":null,\"FProperty\":0,\"FProperty_FName\":null,\"FTypeID\":500,\"FTypeID_FName\":\"普通仓\",\"FSPGroupID\":0,\"FSPGroupID_FName\":\"*\"}]}";
str = JSON.parseObject(str,String.class);
        String str2 = "{\"status\":\"0\",\"msg\":\"ok\",\"datas\":[{\"FRECORDS\":1,\"FSPID\":167,\"FSPGroupID\":30,\"FNumber\":\"2-1\",\"FName\":\"包材仓\",\"FFullName\":\"成品库仓位_包材仓\",\"FFullNumber\":\"2-1\",\"FShortNumber\":\"2-1\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"V\",\"FGroupName\":\"成品库仓位\",\"FDescription\":null},{\"FRECORDS\":2,\"FSPID\":60,\"FSPGroupID\":21,\"FNumber\":\"003\",\"FName\":\"T-3\",\"FFullName\":\"T_T-3\",\"FFullNumber\":\"003\",\"FShortNumber\":\"003\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"020\",\"FGroupName\":\"T\",\"FDescription\":null},{\"FRECORDS\":3,\"FSPID\":116,\"FSPGroupID\":1,\"FNumber\":\"060\",\"FName\":\"T-3\",\"FFullName\":\"原材料_T-3\",\"FFullNumber\":\"060\",\"FShortNumber\":\"060\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":4,\"FSPID\":115,\"FSPGroupID\":1,\"FNumber\":\"059\",\"FName\":\"T-2\",\"FFullName\":\"原材料_T-2\",\"FFullNumber\":\"059\",\"FShortNumber\":\"059\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":5,\"FSPID\":59,\"FSPGroupID\":21,\"FNumber\":\"002\",\"FName\":\"T-2\",\"FFullName\":\"T_T-2\",\"FFullNumber\":\"002\",\"FShortNumber\":\"002\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"020\",\"FGroupName\":\"T\",\"FDescription\":null},{\"FRECORDS\":6,\"FSPID\":58,\"FSPGroupID\":21,\"FNumber\":\"001\",\"FName\":\"T-1\",\"FFullName\":\"T_T-1\",\"FFullNumber\":\"001\",\"FShortNumber\":\"001\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"020\",\"FGroupName\":\"T\",\"FDescription\":null},{\"FRECORDS\":7,\"FSPID\":114,\"FSPGroupID\":1,\"FNumber\":\"058\",\"FName\":\"T-1\",\"FFullName\":\"原材料_T-1\",\"FFullNumber\":\"058\",\"FShortNumber\":\"058\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":8,\"FSPID\":113,\"FSPGroupID\":1,\"FNumber\":\"057\",\"FName\":\"S-3\",\"FFullName\":\"原材料_S-3\",\"FFullNumber\":\"057\",\"FShortNumber\":\"057\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":9,\"FSPID\":57,\"FSPGroupID\":20,\"FNumber\":\"003\",\"FName\":\"S-3\",\"FFullName\":\"S_S-3\",\"FFullNumber\":\"003\",\"FShortNumber\":\"003\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"019\",\"FGroupName\":\"S\",\"FDescription\":null},{\"FRECORDS\":10,\"FSPID\":56,\"FSPGroupID\":20,\"FNumber\":\"002\",\"FName\":\"S-2\",\"FFullName\":\"S_S-2\",\"FFullNumber\":\"002\",\"FShortNumber\":\"002\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"019\",\"FGroupName\":\"S\",\"FDescription\":null},{\"FRECORDS\":11,\"FSPID\":112,\"FSPGroupID\":1,\"FNumber\":\"056\",\"FName\":\"S-2\",\"FFullName\":\"原材料_S-2\",\"FFullNumber\":\"056\",\"FShortNumber\":\"056\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":12,\"FSPID\":111,\"FSPGroupID\":1,\"FNumber\":\"055\",\"FName\":\"S-1\",\"FFullName\":\"原材料_S-1\",\"FFullNumber\":\"055\",\"FShortNumber\":\"055\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":13,\"FSPID\":55,\"FSPGroupID\":20,\"FNumber\":\"001\",\"FName\":\"S-1\",\"FFullName\":\"S_S-1\",\"FFullNumber\":\"001\",\"FShortNumber\":\"001\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"019\",\"FGroupName\":\"S\",\"FDescription\":null},{\"FRECORDS\":14,\"FSPID\":54,\"FSPGroupID\":19,\"FNumber\":\"003\",\"FName\":\"R-3\",\"FFullName\":\"R_R-3\",\"FFullNumber\":\"003\",\"FShortNumber\":\"003\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"018\",\"FGroupName\":\"R\",\"FDescription\":null},{\"FRECORDS\":15,\"FSPID\":110,\"FSPGroupID\":1,\"FNumber\":\"054\",\"FName\":\"R-3\",\"FFullName\":\"原材料_R-3\",\"FFullNumber\":\"054\",\"FShortNumber\":\"054\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":16,\"FSPID\":109,\"FSPGroupID\":1,\"FNumber\":\"053\",\"FName\":\"R-2\",\"FFullName\":\"原材料_R-2\",\"FFullNumber\":\"053\",\"FShortNumber\":\"053\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":17,\"FSPID\":53,\"FSPGroupID\":19,\"FNumber\":\"002\",\"FName\":\"R-2\",\"FFullName\":\"R_R-2\",\"FFullNumber\":\"002\",\"FShortNumber\":\"002\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"018\",\"FGroupName\":\"R\",\"FDescription\":null},{\"FRECORDS\":18,\"FSPID\":52,\"FSPGroupID\":19,\"FNumber\":\"001\",\"FName\":\"R-1\",\"FFullName\":\"R_R-1\",\"FFullNumber\":\"001\",\"FShortNumber\":\"001\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"018\",\"FGroupName\":\"R\",\"FDescription\":null},{\"FRECORDS\":19,\"FSPID\":108,\"FSPGroupID\":1,\"FNumber\":\"052\",\"FName\":\"R-1\",\"FFullName\":\"原材料_R-1\",\"FFullNumber\":\"052\",\"FShortNumber\":\"052\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":20,\"FSPID\":106,\"FSPGroupID\":1,\"FNumber\":\"051\",\"FName\":\"Q-3\",\"FFullName\":\"原材料_Q-3\",\"FFullNumber\":\"051\",\"FShortNumber\":\"051\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":21,\"FSPID\":51,\"FSPGroupID\":18,\"FNumber\":\"003\",\"FName\":\"Q-3\",\"FFullName\":\"Q_Q-3\",\"FFullNumber\":\"003\",\"FShortNumber\":\"003\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"017\",\"FGroupName\":\"Q\",\"FDescription\":null},{\"FRECORDS\":22,\"FSPID\":50,\"FSPGroupID\":18,\"FNumber\":\"002\",\"FName\":\"Q-2\",\"FFullName\":\"Q_Q-2\",\"FFullNumber\":\"002\",\"FShortNumber\":\"002\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"017\",\"FGroupName\":\"Q\",\"FDescription\":null},{\"FRECORDS\":23,\"FSPID\":105,\"FSPGroupID\":1,\"FNumber\":\"050\",\"FName\":\"Q-2\",\"FFullName\":\"原材料_Q-2\",\"FFullNumber\":\"050\",\"FShortNumber\":\"050\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":24,\"FSPID\":107,\"FSPGroupID\":1,\"FNumber\":\"049\",\"FName\":\"Q-1\",\"FFullName\":\"原材料_Q-1\",\"FFullNumber\":\"049\",\"FShortNumber\":\"049\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":25,\"FSPID\":49,\"FSPGroupID\":18,\"FNumber\":\"001\",\"FName\":\"Q-1\",\"FFullName\":\"Q_Q-1\",\"FFullNumber\":\"001\",\"FShortNumber\":\"001\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"017\",\"FGroupName\":\"Q\",\"FDescription\":null},{\"FRECORDS\":26,\"FSPID\":118,\"FSPGroupID\":1,\"FNumber\":\"061\",\"FName\":\"P-4\",\"FFullName\":\"原材料_P-4\",\"FFullNumber\":\"061\",\"FShortNumber\":\"061\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":27,\"FSPID\":104,\"FSPGroupID\":1,\"FNumber\":\"048\",\"FName\":\"P-3\",\"FFullName\":\"原材料_P-3\",\"FFullNumber\":\"048\",\"FShortNumber\":\"048\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":28,\"FSPID\":48,\"FSPGroupID\":17,\"FNumber\":\"003\",\"FName\":\"P-3\",\"FFullName\":\"P_P-3\",\"FFullNumber\":\"003\",\"FShortNumber\":\"003\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"016\",\"FGroupName\":\"P\",\"FDescription\":null},{\"FRECORDS\":29,\"FSPID\":47,\"FSPGroupID\":17,\"FNumber\":\"002\",\"FName\":\"P-2\",\"FFullName\":\"P_P-2\",\"FFullNumber\":\"002\",\"FShortNumber\":\"002\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"016\",\"FGroupName\":\"P\",\"FDescription\":null},{\"FRECORDS\":30,\"FSPID\":103,\"FSPGroupID\":1,\"FNumber\":\"047\",\"FName\":\"P-2\",\"FFullName\":\"原材料_P-2\",\"FFullNumber\":\"047\",\"FShortNumber\":\"047\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":31,\"FSPID\":102,\"FSPGroupID\":1,\"FNumber\":\"046\",\"FName\":\"P-1\",\"FFullName\":\"原材料_P-1\",\"FFullNumber\":\"046\",\"FShortNumber\":\"046\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":32,\"FSPID\":46,\"FSPGroupID\":17,\"FNumber\":\"001\",\"FName\":\"P-1\",\"FFullName\":\"P_P-1\",\"FFullNumber\":\"001\",\"FShortNumber\":\"001\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"016\",\"FGroupName\":\"P\",\"FDescription\":null},{\"FRECORDS\":33,\"FSPID\":45,\"FSPGroupID\":16,\"FNumber\":\"003\",\"FName\":\"O-3\",\"FFullName\":\"O_O-3\",\"FFullNumber\":\"003\",\"FShortNumber\":\"003\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"015\",\"FGroupName\":\"O\",\"FDescription\":null},{\"FRECORDS\":34,\"FSPID\":101,\"FSPGroupID\":1,\"FNumber\":\"045\",\"FName\":\"O-3\",\"FFullName\":\"原材料_O-3\",\"FFullNumber\":\"045\",\"FShortNumber\":\"045\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":35,\"FSPID\":100,\"FSPGroupID\":1,\"FNumber\":\"044\",\"FName\":\"O-2\",\"FFullName\":\"原材料_O-2\",\"FFullNumber\":\"044\",\"FShortNumber\":\"044\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":36,\"FSPID\":44,\"FSPGroupID\":16,\"FNumber\":\"002\",\"FName\":\"O-2\",\"FFullName\":\"O_O-2\",\"FFullNumber\":\"002\",\"FShortNumber\":\"002\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"015\",\"FGroupName\":\"O\",\"FDescription\":null},{\"FRECORDS\":37,\"FSPID\":43,\"FSPGroupID\":16,\"FNumber\":\"001\",\"FName\":\"O-1\",\"FFullName\":\"O_O-1\",\"FFullNumber\":\"001\",\"FShortNumber\":\"001\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"015\",\"FGroupName\":\"O\",\"FDescription\":null},{\"FRECORDS\":38,\"FSPID\":99,\"FSPGroupID\":1,\"FNumber\":\"043\",\"FName\":\"O-1\",\"FFullName\":\"原材料_O-1\",\"FFullNumber\":\"043\",\"FShortNumber\":\"043\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":39,\"FSPID\":98,\"FSPGroupID\":1,\"FNumber\":\"042\",\"FName\":\"N-3\",\"FFullName\":\"原材料_N-3\",\"FFullNumber\":\"042\",\"FShortNumber\":\"042\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":40,\"FSPID\":42,\"FSPGroupID\":15,\"FNumber\":\"003\",\"FName\":\"N-3\",\"FFullName\":\"N_N-3\",\"FFullNumber\":\"003\",\"FShortNumber\":\"003\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"014\",\"FGroupName\":\"N\",\"FDescription\":null},{\"FRECORDS\":41,\"FSPID\":41,\"FSPGroupID\":15,\"FNumber\":\"002\",\"FName\":\"N-2\",\"FFullName\":\"N_N-2\",\"FFullNumber\":\"002\",\"FShortNumber\":\"002\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"014\",\"FGroupName\":\"N\",\"FDescription\":null},{\"FRECORDS\":42,\"FSPID\":97,\"FSPGroupID\":1,\"FNumber\":\"041\",\"FName\":\"N-2\",\"FFullName\":\"原材料_N-2\",\"FFullNumber\":\"041\",\"FShortNumber\":\"041\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":43,\"FSPID\":96,\"FSPGroupID\":1,\"FNumber\":\"040\",\"FName\":\"N-1\",\"FFullName\":\"原材料_N-1\",\"FFullNumber\":\"040\",\"FShortNumber\":\"040\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":44,\"FSPID\":40,\"FSPGroupID\":15,\"FNumber\":\"001\",\"FName\":\"N-1\",\"FFullName\":\"N_N-1\",\"FFullNumber\":\"001\",\"FShortNumber\":\"001\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"014\",\"FGroupName\":\"N\",\"FDescription\":null},{\"FRECORDS\":45,\"FSPID\":39,\"FSPGroupID\":14,\"FNumber\":\"003\",\"FName\":\"M-3\",\"FFullName\":\"M_M-3\",\"FFullNumber\":\"003\",\"FShortNumber\":\"003\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"013\",\"FGroupName\":\"M\",\"FDescription\":null},{\"FRECORDS\":46,\"FSPID\":95,\"FSPGroupID\":1,\"FNumber\":\"039\",\"FName\":\"M-3\",\"FFullName\":\"原材料_M-3\",\"FFullNumber\":\"039\",\"FShortNumber\":\"039\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":47,\"FSPID\":94,\"FSPGroupID\":1,\"FNumber\":\"038\",\"FName\":\"M-2\",\"FFullName\":\"原材料_M-2\",\"FFullNumber\":\"038\",\"FShortNumber\":\"038\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":48,\"FSPID\":38,\"FSPGroupID\":14,\"FNumber\":\"002\",\"FName\":\"M-2\",\"FFullName\":\"M_M-2\",\"FFullNumber\":\"002\",\"FShortNumber\":\"002\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"013\",\"FGroupName\":\"M\",\"FDescription\":null},{\"FRECORDS\":49,\"FSPID\":37,\"FSPGroupID\":14,\"FNumber\":\"001\",\"FName\":\"M-1\",\"FFullName\":\"M_M-1\",\"FFullNumber\":\"001\",\"FShortNumber\":\"001\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"013\",\"FGroupName\":\"M\",\"FDescription\":null},{\"FRECORDS\":50,\"FSPID\":93,\"FSPGroupID\":1,\"FNumber\":\"037\",\"FName\":\"M-1\",\"FFullName\":\"原材料_M-1\",\"FFullNumber\":\"037\",\"FShortNumber\":\"037\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":51,\"FSPID\":92,\"FSPGroupID\":1,\"FNumber\":\"036\",\"FName\":\"L-3\",\"FFullName\":\"原材料_L-3\",\"FFullNumber\":\"036\",\"FShortNumber\":\"036\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":52,\"FSPID\":36,\"FSPGroupID\":13,\"FNumber\":\"003\",\"FName\":\"L-3\",\"FFullName\":\"L_L-3\",\"FFullNumber\":\"003\",\"FShortNumber\":\"003\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"012\",\"FGroupName\":\"L\",\"FDescription\":null},{\"FRECORDS\":53,\"FSPID\":35,\"FSPGroupID\":13,\"FNumber\":\"002\",\"FName\":\"L-2\",\"FFullName\":\"L_L-2\",\"FFullNumber\":\"002\",\"FShortNumber\":\"002\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"012\",\"FGroupName\":\"L\",\"FDescription\":null},{\"FRECORDS\":54,\"FSPID\":91,\"FSPGroupID\":1,\"FNumber\":\"035\",\"FName\":\"L-2\",\"FFullName\":\"原材料_L-2\",\"FFullNumber\":\"035\",\"FShortNumber\":\"035\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":55,\"FSPID\":90,\"FSPGroupID\":1,\"FNumber\":\"034\",\"FName\":\"L-1\",\"FFullName\":\"原材料_L-1\",\"FFullNumber\":\"034\",\"FShortNumber\":\"034\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":56,\"FSPID\":34,\"FSPGroupID\":13,\"FNumber\":\"001\",\"FName\":\"L-1\",\"FFullName\":\"L_L-1\",\"FFullNumber\":\"001\",\"FShortNumber\":\"001\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"012\",\"FGroupName\":\"L\",\"FDescription\":null},{\"FRECORDS\":57,\"FSPID\":33,\"FSPGroupID\":12,\"FNumber\":\"003\",\"FName\":\"K-3\",\"FFullName\":\"K_K-3\",\"FFullNumber\":\"003\",\"FShortNumber\":\"003\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"011\",\"FGroupName\":\"K\",\"FDescription\":null},{\"FRECORDS\":58,\"FSPID\":89,\"FSPGroupID\":1,\"FNumber\":\"033\",\"FName\":\"K-3\",\"FFullName\":\"原材料_K-3\",\"FFullNumber\":\"033\",\"FShortNumber\":\"033\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":59,\"FSPID\":88,\"FSPGroupID\":1,\"FNumber\":\"032\",\"FName\":\"K-2\",\"FFullName\":\"原材料_K-2\",\"FFullNumber\":\"032\",\"FShortNumber\":\"032\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":60,\"FSPID\":32,\"FSPGroupID\":12,\"FNumber\":\"002\",\"FName\":\"K-2\",\"FFullName\":\"K_K-2\",\"FFullNumber\":\"002\",\"FShortNumber\":\"002\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"011\",\"FGroupName\":\"K\",\"FDescription\":null},{\"FRECORDS\":61,\"FSPID\":31,\"FSPGroupID\":12,\"FNumber\":\"001\",\"FName\":\"K-1\",\"FFullName\":\"K_K-1\",\"FFullNumber\":\"001\",\"FShortNumber\":\"001\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"011\",\"FGroupName\":\"K\",\"FDescription\":null},{\"FRECORDS\":62,\"FSPID\":87,\"FSPGroupID\":1,\"FNumber\":\"031\",\"FName\":\"K-1\",\"FFullName\":\"原材料_K-1\",\"FFullNumber\":\"031\",\"FShortNumber\":\"031\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":63,\"FSPID\":86,\"FSPGroupID\":1,\"FNumber\":\"030\",\"FName\":\"J-3\",\"FFullName\":\"原材料_J-3\",\"FFullNumber\":\"030\",\"FShortNumber\":\"030\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":64,\"FSPID\":30,\"FSPGroupID\":11,\"FNumber\":\"003\",\"FName\":\"J-3\",\"FFullName\":\"J_J-3\",\"FFullNumber\":\"003\",\"FShortNumber\":\"003\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"010\",\"FGroupName\":\"J\",\"FDescription\":null},{\"FRECORDS\":65,\"FSPID\":29,\"FSPGroupID\":11,\"FNumber\":\"002\",\"FName\":\"J-2\",\"FFullName\":\"J_J-2\",\"FFullNumber\":\"002\",\"FShortNumber\":\"002\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"010\",\"FGroupName\":\"J\",\"FDescription\":null},{\"FRECORDS\":66,\"FSPID\":85,\"FSPGroupID\":1,\"FNumber\":\"029\",\"FName\":\"J-2\",\"FFullName\":\"原材料_J-2\",\"FFullNumber\":\"029\",\"FShortNumber\":\"029\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":67,\"FSPID\":84,\"FSPGroupID\":1,\"FNumber\":\"028\",\"FName\":\"J-1\",\"FFullName\":\"原材料_J-1\",\"FFullNumber\":\"028\",\"FShortNumber\":\"028\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":68,\"FSPID\":28,\"FSPGroupID\":11,\"FNumber\":\"001\",\"FName\":\"J-1\",\"FFullName\":\"J_J-1\",\"FFullNumber\":\"001\",\"FShortNumber\":\"001\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"010\",\"FGroupName\":\"J\",\"FDescription\":null},{\"FRECORDS\":69,\"FSPID\":27,\"FSPGroupID\":10,\"FNumber\":\"003\",\"FName\":\"I-3\",\"FFullName\":\"I_I-3\",\"FFullNumber\":\"003\",\"FShortNumber\":\"003\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"009\",\"FGroupName\":\"I\",\"FDescription\":null},{\"FRECORDS\":70,\"FSPID\":83,\"FSPGroupID\":1,\"FNumber\":\"027\",\"FName\":\"I-3\",\"FFullName\":\"原材料_I-3\",\"FFullNumber\":\"027\",\"FShortNumber\":\"027\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":71,\"FSPID\":82,\"FSPGroupID\":1,\"FNumber\":\"026\",\"FName\":\"I-2\",\"FFullName\":\"原材料_I-2\",\"FFullNumber\":\"026\",\"FShortNumber\":\"026\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":72,\"FSPID\":26,\"FSPGroupID\":10,\"FNumber\":\"002\",\"FName\":\"I-2\",\"FFullName\":\"I_I-2\",\"FFullNumber\":\"002\",\"FShortNumber\":\"002\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"009\",\"FGroupName\":\"I\",\"FDescription\":null},{\"FRECORDS\":73,\"FSPID\":25,\"FSPGroupID\":10,\"FNumber\":\"001\",\"FName\":\"I-1\",\"FFullName\":\"I_I-1\",\"FFullNumber\":\"001\",\"FShortNumber\":\"001\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"009\",\"FGroupName\":\"I\",\"FDescription\":null},{\"FRECORDS\":74,\"FSPID\":81,\"FSPGroupID\":1,\"FNumber\":\"025\",\"FName\":\"I-1\",\"FFullName\":\"原材料_I-1\",\"FFullNumber\":\"025\",\"FShortNumber\":\"025\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":75,\"FSPID\":80,\"FSPGroupID\":1,\"FNumber\":\"024\",\"FName\":\"H-3\",\"FFullName\":\"原材料_H-3\",\"FFullNumber\":\"024\",\"FShortNumber\":\"024\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":76,\"FSPID\":24,\"FSPGroupID\":9,\"FNumber\":\"003\",\"FName\":\"H-3\",\"FFullName\":\"H_H-3\",\"FFullNumber\":\"003\",\"FShortNumber\":\"003\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"008\",\"FGroupName\":\"H\",\"FDescription\":null},{\"FRECORDS\":77,\"FSPID\":23,\"FSPGroupID\":9,\"FNumber\":\"002\",\"FName\":\"H-2\",\"FFullName\":\"H_H-2\",\"FFullNumber\":\"002\",\"FShortNumber\":\"002\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"008\",\"FGroupName\":\"H\",\"FDescription\":null},{\"FRECORDS\":78,\"FSPID\":79,\"FSPGroupID\":1,\"FNumber\":\"023\",\"FName\":\"H-2\",\"FFullName\":\"原材料_H-2\",\"FFullNumber\":\"023\",\"FShortNumber\":\"023\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":79,\"FSPID\":78,\"FSPGroupID\":1,\"FNumber\":\"022\",\"FName\":\"H-1\",\"FFullName\":\"原材料_H-1\",\"FFullNumber\":\"022\",\"FShortNumber\":\"022\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":80,\"FSPID\":22,\"FSPGroupID\":9,\"FNumber\":\"001\",\"FName\":\"H-1\",\"FFullName\":\"H_H-1\",\"FFullNumber\":\"001\",\"FShortNumber\":\"001\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"008\",\"FGroupName\":\"H\",\"FDescription\":null},{\"FRECORDS\":81,\"FSPID\":21,\"FSPGroupID\":8,\"FNumber\":\"003\",\"FName\":\"G-3\",\"FFullName\":\"G_G-3\",\"FFullNumber\":\"003\",\"FShortNumber\":\"003\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"007\",\"FGroupName\":\"G\",\"FDescription\":null},{\"FRECORDS\":82,\"FSPID\":77,\"FSPGroupID\":1,\"FNumber\":\"021\",\"FName\":\"G-3\",\"FFullName\":\"原材料_G-3\",\"FFullNumber\":\"021\",\"FShortNumber\":\"021\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":83,\"FSPID\":76,\"FSPGroupID\":1,\"FNumber\":\"020\",\"FName\":\"G-2\",\"FFullName\":\"原材料_G-2\",\"FFullNumber\":\"020\",\"FShortNumber\":\"020\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":84,\"FSPID\":20,\"FSPGroupID\":8,\"FNumber\":\"002\",\"FName\":\"G-2\",\"FFullName\":\"G_G-2\",\"FFullNumber\":\"002\",\"FShortNumber\":\"002\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"007\",\"FGroupName\":\"G\",\"FDescription\":null},{\"FRECORDS\":85,\"FSPID\":19,\"FSPGroupID\":8,\"FNumber\":\"001\",\"FName\":\"G-1\",\"FFullName\":\"G_G-1\",\"FFullNumber\":\"001\",\"FShortNumber\":\"001\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"007\",\"FGroupName\":\"G\",\"FDescription\":null},{\"FRECORDS\":86,\"FSPID\":75,\"FSPGroupID\":1,\"FNumber\":\"019\",\"FName\":\"G-1\",\"FFullName\":\"原材料_G-1\",\"FFullNumber\":\"019\",\"FShortNumber\":\"019\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":87,\"FSPID\":74,\"FSPGroupID\":1,\"FNumber\":\"018\",\"FName\":\"F-3\",\"FFullName\":\"原材料_F-3\",\"FFullNumber\":\"018\",\"FShortNumber\":\"018\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":88,\"FSPID\":18,\"FSPGroupID\":7,\"FNumber\":\"003\",\"FName\":\"F-3\",\"FFullName\":\"F_F-3\",\"FFullNumber\":\"003\",\"FShortNumber\":\"003\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"006\",\"FGroupName\":\"F\",\"FDescription\":null},{\"FRECORDS\":89,\"FSPID\":17,\"FSPGroupID\":7,\"FNumber\":\"002\",\"FName\":\"F-2\",\"FFullName\":\"F_F-2\",\"FFullNumber\":\"002\",\"FShortNumber\":\"002\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"006\",\"FGroupName\":\"F\",\"FDescription\":null},{\"FRECORDS\":90,\"FSPID\":73,\"FSPGroupID\":1,\"FNumber\":\"017\",\"FName\":\"F-2\",\"FFullName\":\"原材料_F-2\",\"FFullNumber\":\"017\",\"FShortNumber\":\"017\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":91,\"FSPID\":72,\"FSPGroupID\":1,\"FNumber\":\"016\",\"FName\":\"F-1\",\"FFullName\":\"原材料_F-1\",\"FFullNumber\":\"016\",\"FShortNumber\":\"016\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":92,\"FSPID\":16,\"FSPGroupID\":7,\"FNumber\":\"001\",\"FName\":\"F-1\",\"FFullName\":\"F_F-1\",\"FFullNumber\":\"001\",\"FShortNumber\":\"001\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"006\",\"FGroupName\":\"F\",\"FDescription\":null},{\"FRECORDS\":93,\"FSPID\":15,\"FSPGroupID\":6,\"FNumber\":\"003\",\"FName\":\"E-3\",\"FFullName\":\"E_E-3\",\"FFullNumber\":\"003\",\"FShortNumber\":\"003\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"005\",\"FGroupName\":\"E\",\"FDescription\":null},{\"FRECORDS\":94,\"FSPID\":71,\"FSPGroupID\":1,\"FNumber\":\"015\",\"FName\":\"E-3\",\"FFullName\":\"原材料_E-3\",\"FFullNumber\":\"015\",\"FShortNumber\":\"015\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":95,\"FSPID\":14,\"FSPGroupID\":6,\"FNumber\":\"002\",\"FName\":\"E-2\",\"FFullName\":\"E_E-2\",\"FFullNumber\":\"002\",\"FShortNumber\":\"002\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"005\",\"FGroupName\":\"E\",\"FDescription\":null},{\"FRECORDS\":96,\"FSPID\":70,\"FSPGroupID\":1,\"FNumber\":\"014\",\"FName\":\"E-2\",\"FFullName\":\"原材料_E-2\",\"FFullNumber\":\"014\",\"FShortNumber\":\"014\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":97,\"FSPID\":69,\"FSPGroupID\":1,\"FNumber\":\"013\",\"FName\":\"E-1\",\"FFullName\":\"原材料_E-1\",\"FFullNumber\":\"013\",\"FShortNumber\":\"013\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":98,\"FSPID\":13,\"FSPGroupID\":6,\"FNumber\":\"001\",\"FName\":\"E-1\",\"FFullName\":\"E_E-1\",\"FFullNumber\":\"001\",\"FShortNumber\":\"001\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"005\",\"FGroupName\":\"E\",\"FDescription\":null},{\"FRECORDS\":99,\"FSPID\":12,\"FSPGroupID\":5,\"FNumber\":\"003\",\"FName\":\"D-3\",\"FFullName\":\"D_D-3\",\"FFullNumber\":\"003\",\"FShortNumber\":\"003\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"004\",\"FGroupName\":\"D\",\"FDescription\":null},{\"FRECORDS\":100,\"FSPID\":68,\"FSPGroupID\":1,\"FNumber\":\"012\",\"FName\":\"D-3\",\"FFullName\":\"原材料_D-3\",\"FFullNumber\":\"012\",\"FShortNumber\":\"012\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":101,\"FSPID\":67,\"FSPGroupID\":1,\"FNumber\":\"011\",\"FName\":\"D-2\",\"FFullName\":\"原材料_D-2\",\"FFullNumber\":\"011\",\"FShortNumber\":\"011\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":102,\"FSPID\":11,\"FSPGroupID\":5,\"FNumber\":\"002\",\"FName\":\"D-2\",\"FFullName\":\"D_D-2\",\"FFullNumber\":\"002\",\"FShortNumber\":\"002\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"004\",\"FGroupName\":\"D\",\"FDescription\":null},{\"FRECORDS\":103,\"FSPID\":10,\"FSPGroupID\":5,\"FNumber\":\"001\",\"FName\":\"D-1\",\"FFullName\":\"D_D-1\",\"FFullNumber\":\"001\",\"FShortNumber\":\"001\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"004\",\"FGroupName\":\"D\",\"FDescription\":null},{\"FRECORDS\":104,\"FSPID\":66,\"FSPGroupID\":1,\"FNumber\":\"010\",\"FName\":\"D-1\",\"FFullName\":\"原材料_D-1\",\"FFullNumber\":\"010\",\"FShortNumber\":\"010\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":105,\"FSPID\":117,\"FSPGroupID\":1,\"FNumber\":\"009\",\"FName\":\"C-3\",\"FFullName\":\"原材料_C-3\",\"FFullNumber\":\"009\",\"FShortNumber\":\"009\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":106,\"FSPID\":65,\"FSPGroupID\":1,\"FNumber\":\"008\",\"FName\":\"C-2\",\"FFullName\":\"原材料_C-2\",\"FFullNumber\":\"008\",\"FShortNumber\":\"008\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":107,\"FSPID\":64,\"FSPGroupID\":1,\"FNumber\":\"007\",\"FName\":\"C-1\",\"FFullName\":\"原材料_C-1\",\"FFullNumber\":\"007\",\"FShortNumber\":\"007\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":108,\"FSPID\":63,\"FSPGroupID\":1,\"FNumber\":\"006\",\"FName\":\"B-3\",\"FFullName\":\"原材料_B-3\",\"FFullNumber\":\"006\",\"FShortNumber\":\"006\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":109,\"FSPID\":62,\"FSPGroupID\":1,\"FNumber\":\"005\",\"FName\":\"B-2\",\"FFullName\":\"原材料_B-2\",\"FFullNumber\":\"005\",\"FShortNumber\":\"005\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":110,\"FSPID\":5,\"FSPGroupID\":1,\"FNumber\":\"004\",\"FName\":\"B-1\",\"FFullName\":\"原材料_B-1\",\"FFullNumber\":\"004\",\"FShortNumber\":\"004\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":111,\"FSPID\":61,\"FSPGroupID\":1,\"FNumber\":\"003\",\"FName\":\"A-3\",\"FFullName\":\"原材料_A-3\",\"FFullNumber\":\"003\",\"FShortNumber\":\"003\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":112,\"FSPID\":4,\"FSPGroupID\":1,\"FNumber\":\"002\",\"FName\":\"A-2\",\"FFullName\":\"原材料_A-2\",\"FFullNumber\":\"002\",\"FShortNumber\":\"002\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":113,\"FSPID\":3,\"FSPGroupID\":1,\"FNumber\":\"001\",\"FName\":\"A-1\",\"FFullName\":\"原材料_A-1\",\"FFullNumber\":\"001\",\"FShortNumber\":\"001\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"001\",\"FGroupName\":\"原材料\",\"FDescription\":null},{\"FRECORDS\":114,\"FSPID\":166,\"FSPGroupID\":29,\"FNumber\":\"2-5\",\"FName\":\"2-5\",\"FFullName\":\"新原材料_2-5\",\"FFullNumber\":\"2-5\",\"FShortNumber\":\"2-5\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":115,\"FSPID\":165,\"FSPGroupID\":29,\"FNumber\":\"2-4\",\"FName\":\"2-4\",\"FFullName\":\"新原材料_2-4\",\"FFullNumber\":\"2-4\",\"FShortNumber\":\"2-4\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":116,\"FSPID\":164,\"FSPGroupID\":29,\"FNumber\":\"2-3\",\"FName\":\"2-3\",\"FFullName\":\"新原材料_2-3\",\"FFullNumber\":\"2-3\",\"FShortNumber\":\"2-3\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":117,\"FSPID\":163,\"FSPGroupID\":29,\"FNumber\":\"2-2\",\"FName\":\"2-2\",\"FFullName\":\"新原材料_2-2\",\"FFullNumber\":\"2-2\",\"FShortNumber\":\"2-2\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":118,\"FSPID\":162,\"FSPGroupID\":29,\"FNumber\":\"2-1\",\"FName\":\"2-1\",\"FFullName\":\"新原材料_2-1\",\"FFullNumber\":\"2-1\",\"FShortNumber\":\"2-1\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":119,\"FSPID\":128,\"FSPGroupID\":29,\"FNumber\":\"1-9\",\"FName\":\"1-9\",\"FFullName\":\"新原材料_1-9\",\"FFullNumber\":\"1-9\",\"FShortNumber\":\"1-9\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":120,\"FSPID\":127,\"FSPGroupID\":29,\"FNumber\":\"1-8\",\"FName\":\"1-8\",\"FFullName\":\"新原材料_1-8\",\"FFullNumber\":\"1-8\",\"FShortNumber\":\"1-8\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":121,\"FSPID\":126,\"FSPGroupID\":29,\"FNumber\":\"1-7\",\"FName\":\"1-7\",\"FFullName\":\"新原材料_1-7\",\"FFullNumber\":\"1-7\",\"FShortNumber\":\"1-7\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":122,\"FSPID\":125,\"FSPGroupID\":29,\"FNumber\":\"1-6\",\"FName\":\"1-6\",\"FFullName\":\"新原材料_1-6\",\"FFullNumber\":\"1-6\",\"FShortNumber\":\"1-6\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":123,\"FSPID\":124,\"FSPGroupID\":29,\"FNumber\":\"1-5\",\"FName\":\"1-5\",\"FFullName\":\"新原材料_1-5\",\"FFullNumber\":\"1-5\",\"FShortNumber\":\"1-5\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":124,\"FSPID\":161,\"FSPGroupID\":30,\"FNumber\":\"1-5\",\"FName\":\"1-5\",\"FFullName\":\"成品库仓位_1-5\",\"FFullNumber\":\"1-5\",\"FShortNumber\":\"1-5\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"V\",\"FGroupName\":\"成品库仓位\",\"FDescription\":null},{\"FRECORDS\":125,\"FSPID\":160,\"FSPGroupID\":30,\"FNumber\":\"1-4\",\"FName\":\"1-4\",\"FFullName\":\"成品库仓位_1-4\",\"FFullNumber\":\"1-4\",\"FShortNumber\":\"1-4\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"V\",\"FGroupName\":\"成品库仓位\",\"FDescription\":null},{\"FRECORDS\":126,\"FSPID\":123,\"FSPGroupID\":29,\"FNumber\":\"1-4\",\"FName\":\"1-4\",\"FFullName\":\"新原材料_1-4\",\"FFullNumber\":\"1-4\",\"FShortNumber\":\"1-4\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":127,\"FSPID\":156,\"FSPGroupID\":29,\"FNumber\":\"1-37\",\"FName\":\"1-37\",\"FFullName\":\"新原材料_1-37\",\"FFullNumber\":\"1-37\",\"FShortNumber\":\"1-37\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":128,\"FSPID\":155,\"FSPGroupID\":29,\"FNumber\":\"1-36\",\"FName\":\"1-36\",\"FFullName\":\"新原材料_1-36\",\"FFullNumber\":\"1-36\",\"FShortNumber\":\"1-36\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":129,\"FSPID\":154,\"FSPGroupID\":29,\"FNumber\":\"1-35\",\"FName\":\"1-35\",\"FFullName\":\"新原材料_1-35\",\"FFullNumber\":\"1-35\",\"FShortNumber\":\"1-35\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":130,\"FSPID\":153,\"FSPGroupID\":29,\"FNumber\":\"1-34\",\"FName\":\"1-34\",\"FFullName\":\"新原材料_1-34\",\"FFullNumber\":\"1-34\",\"FShortNumber\":\"1-34\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":131,\"FSPID\":152,\"FSPGroupID\":29,\"FNumber\":\"1-33\",\"FName\":\"1-33\",\"FFullName\":\"新原材料_1-33\",\"FFullNumber\":\"1-33\",\"FShortNumber\":\"1-33\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":132,\"FSPID\":151,\"FSPGroupID\":29,\"FNumber\":\"1-32\",\"FName\":\"1-32\",\"FFullName\":\"新原材料_1-32\",\"FFullNumber\":\"1-32\",\"FShortNumber\":\"1-32\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":133,\"FSPID\":150,\"FSPGroupID\":29,\"FNumber\":\"1-31\",\"FName\":\"1-31\",\"FFullName\":\"新原材料_1-31\",\"FFullNumber\":\"1-31\",\"FShortNumber\":\"1-31\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":134,\"FSPID\":149,\"FSPGroupID\":29,\"FNumber\":\"1-30\",\"FName\":\"1-30\",\"FFullName\":\"新原材料_1-30\",\"FFullNumber\":\"1-30\",\"FShortNumber\":\"1-30\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":135,\"FSPID\":159,\"FSPGroupID\":30,\"FNumber\":\"1-3\",\"FName\":\"1-3\",\"FFullName\":\"成品库仓位_1-3\",\"FFullNumber\":\"1-3\",\"FShortNumber\":\"1-3\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"V\",\"FGroupName\":\"成品库仓位\",\"FDescription\":null},{\"FRECORDS\":136,\"FSPID\":122,\"FSPGroupID\":29,\"FNumber\":\"1-3\",\"FName\":\"1-3\",\"FFullName\":\"新原材料_1-3\",\"FFullNumber\":\"1-3\",\"FShortNumber\":\"1-3\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":137,\"FSPID\":148,\"FSPGroupID\":29,\"FNumber\":\"1-29\",\"FName\":\"1-29\",\"FFullName\":\"新原材料_1-29\",\"FFullNumber\":\"1-29\",\"FShortNumber\":\"1-29\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":138,\"FSPID\":147,\"FSPGroupID\":29,\"FNumber\":\"1-28\",\"FName\":\"1-28\",\"FFullName\":\"新原材料_1-28\",\"FFullNumber\":\"1-28\",\"FShortNumber\":\"1-28\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":139,\"FSPID\":146,\"FSPGroupID\":29,\"FNumber\":\"1-27\",\"FName\":\"1-27\",\"FFullName\":\"新原材料_1-27\",\"FFullNumber\":\"1-27\",\"FShortNumber\":\"1-27\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":140,\"FSPID\":145,\"FSPGroupID\":29,\"FNumber\":\"1-26\",\"FName\":\"1-26\",\"FFullName\":\"新原材料_1-26\",\"FFullNumber\":\"1-26\",\"FShortNumber\":\"1-26\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":141,\"FSPID\":144,\"FSPGroupID\":29,\"FNumber\":\"1-25\",\"FName\":\"1-25\",\"FFullName\":\"新原材料_1-25\",\"FFullNumber\":\"1-25\",\"FShortNumber\":\"1-25\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":142,\"FSPID\":143,\"FSPGroupID\":29,\"FNumber\":\"1-24\",\"FName\":\"1-24\",\"FFullName\":\"新原材料_1-24\",\"FFullNumber\":\"1-24\",\"FShortNumber\":\"1-24\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":143,\"FSPID\":142,\"FSPGroupID\":29,\"FNumber\":\"1-23\",\"FName\":\"1-23\",\"FFullName\":\"新原材料_1-23\",\"FFullNumber\":\"1-23\",\"FShortNumber\":\"1-23\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":144,\"FSPID\":141,\"FSPGroupID\":29,\"FNumber\":\"1-22\",\"FName\":\"1-22\",\"FFullName\":\"新原材料_1-22\",\"FFullNumber\":\"1-22\",\"FShortNumber\":\"1-22\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":145,\"FSPID\":140,\"FSPGroupID\":29,\"FNumber\":\"1-21\",\"FName\":\"1-21\",\"FFullName\":\"新原材料_1-21\",\"FFullNumber\":\"1-21\",\"FShortNumber\":\"1-21\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":146,\"FSPID\":139,\"FSPGroupID\":29,\"FNumber\":\"1-20\",\"FName\":\"1-20\",\"FFullName\":\"新原材料_1-20\",\"FFullNumber\":\"1-20\",\"FShortNumber\":\"1-20\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":147,\"FSPID\":158,\"FSPGroupID\":30,\"FNumber\":\"1-2\",\"FName\":\"1-2\",\"FFullName\":\"成品库仓位_1-2\",\"FFullNumber\":\"1-2\",\"FShortNumber\":\"1-2\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"V\",\"FGroupName\":\"成品库仓位\",\"FDescription\":null},{\"FRECORDS\":148,\"FSPID\":121,\"FSPGroupID\":29,\"FNumber\":\"1-2\",\"FName\":\"1-2\",\"FFullName\":\"新原材料_1-2\",\"FFullNumber\":\"1-2\",\"FShortNumber\":\"1-2\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":149,\"FSPID\":138,\"FSPGroupID\":29,\"FNumber\":\"1-19\",\"FName\":\"1-19\",\"FFullName\":\"新原材料_1-19\",\"FFullNumber\":\"1-19\",\"FShortNumber\":\"1-19\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":150,\"FSPID\":137,\"FSPGroupID\":29,\"FNumber\":\"1-18\",\"FName\":\"1-18\",\"FFullName\":\"新原材料_1-18\",\"FFullNumber\":\"1-18\",\"FShortNumber\":\"1-18\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":151,\"FSPID\":136,\"FSPGroupID\":29,\"FNumber\":\"1-17\",\"FName\":\"1-17\",\"FFullName\":\"新原材料_1-17\",\"FFullNumber\":\"1-17\",\"FShortNumber\":\"1-17\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":152,\"FSPID\":135,\"FSPGroupID\":29,\"FNumber\":\"1-16\",\"FName\":\"1-16\",\"FFullName\":\"新原材料_1-16\",\"FFullNumber\":\"1-16\",\"FShortNumber\":\"1-16\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":153,\"FSPID\":134,\"FSPGroupID\":29,\"FNumber\":\"1-15\",\"FName\":\"1-15\",\"FFullName\":\"新原材料_1-15\",\"FFullNumber\":\"1-15\",\"FShortNumber\":\"1-15\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":154,\"FSPID\":133,\"FSPGroupID\":29,\"FNumber\":\"1-14\",\"FName\":\"1-14\",\"FFullName\":\"新原材料_1-14\",\"FFullNumber\":\"1-14\",\"FShortNumber\":\"1-14\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":155,\"FSPID\":132,\"FSPGroupID\":29,\"FNumber\":\"1-13\",\"FName\":\"1-13\",\"FFullName\":\"新原材料_1-13\",\"FFullNumber\":\"1-13\",\"FShortNumber\":\"1-13\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":156,\"FSPID\":131,\"FSPGroupID\":29,\"FNumber\":\"1-12\",\"FName\":\"1-12\",\"FFullName\":\"新原材料_1-12\",\"FFullNumber\":\"1-12\",\"FShortNumber\":\"1-12\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":157,\"FSPID\":130,\"FSPGroupID\":29,\"FNumber\":\"1-11\",\"FName\":\"1-11\",\"FFullName\":\"新原材料_1-11\",\"FFullNumber\":\"1-11\",\"FShortNumber\":\"1-11\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":158,\"FSPID\":129,\"FSPGroupID\":29,\"FNumber\":\"1-10\",\"FName\":\"1-10\",\"FFullName\":\"新原材料_1-10\",\"FFullNumber\":\"1-10\",\"FShortNumber\":\"1-10\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":159,\"FSPID\":120,\"FSPGroupID\":29,\"FNumber\":\"1-1\",\"FName\":\"1-1\",\"FFullName\":\"新原材料_1-1\",\"FFullNumber\":\"1-1\",\"FShortNumber\":\"1-1\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"U\",\"FGroupName\":\"新原材料\",\"FDescription\":null},{\"FRECORDS\":160,\"FSPID\":157,\"FSPGroupID\":30,\"FNumber\":\"1-1\",\"FName\":\"1-1\",\"FFullName\":\"成品库仓位_1-1\",\"FFullNumber\":\"1-1\",\"FShortNumber\":\"1-1\",\"Flevel\":1,\"FDetail\":true,\"FParentID\":0,\"FGroupNumber\":\"V\",\"FGroupName\":\"成品库仓位\",\"FDescription\":null}]}";
        str2 = JSON.parseObject(str2,String.class);
        System.out.println(str2);
    }
    @Override
    public Pair<List<SysWarehouse>, List<SysWarehouseItem>> wareHouseSync() {
        // 仓库
        HashMap<String, Object> paramMap = new HashMap<>();
        paramMap.put("PageSize", "5000");
        paramMap.put("Filter", "");
        paramMap.put("ItemClassId", "5");
        paramMap.put("PageNo", "1");
        paramMap.put("Acct", "XRTEST");
        paramMap.put("QueryType", "0");
        paramMap.put("QueryFields", "FItemId,FNumber,FName,FEmpID,FEmpID_FName,FAddress,FProperty,FProperty_FName,FTypeID_FName,FTypeID,FSPGroupID");
        KisApiResultVOS kisApiResultVOS = postRequest(redisUtil.get(Const.ERP_CONNECT_URL).toString() + "/api/ItemData", paramMap);
        String datas = kisApiResultVOS.getDatas();
        List<KisWareHouseDto> kisWareVOS = JSON.parseArray(datas, KisWareHouseDto.class);
        List<SysWarehouse> sysWarehouses = kisWareVOS.stream().map(item -> item.voToPo(item)).collect(Collectors.toList());
        // 仓位
        HashMap<String, Object> paramLocationMap = new HashMap<>();
        paramLocationMap.put("PageSize", "5000");
        paramLocationMap.put("Filter", "");
        paramLocationMap.put("ItemClassId", "5");
        paramLocationMap.put("PageNo", "1");
        paramLocationMap.put("Acct", "XRTEST");
        paramLocationMap.put("QueryType", "0");
        paramLocationMap.put("QueryFields", "");
        KisApiResultVOS kisLocationApiResultVOS = postRequest(redisUtil.get(Const.ERP_CONNECT_URL).toString() + "/api/BaseData", paramLocationMap);
        String locationDatas = kisLocationApiResultVOS.getDatas();
        List<KisWareLocationDto> kisWareLocationDtos = JSON.parseArray(locationDatas, KisWareLocationDto.class);
        List<SysWarehouseItem> sysWarehouseItems = kisWareLocationDtos.stream().map(item -> item.voToPo(item)).collect(Collectors.toList());
        Pair<List<SysWarehouse>, List<SysWarehouseItem>> bomPair = Pair.of(sysWarehouses, sysWarehouseItems);
        return bomPair;
    }

    @Override
    public List<SysUser> userSync() {
        HashMap<String, Object> paramMap = new HashMap<>();
        // {
        //     "PageSize": "500",
        //         "Filter": "",
        //         "ItemClassId": "3",
        //         "PageNo": "1",
        //         "Acct": "XRTEST",
        //         "QueryType": "0",
        //         "QueryFields": "FItemId,FNumber,FName,FEmpGroup,FEmpGroup_FName,FDepartmentID_FName,FDepartmentID,FGender,FGender_FName,FBirthDay,FDegree,FDegree_FName,FPhone,FMobilePhone,FID,FDuty,FDuty_FName,FHireDate,FLeaveDate,FNAME,FAddress,Fmail,FNote"
        // }
        paramMap.put("PageSize", "5000");
        paramMap.put("Filter", "");
        paramMap.put("ItemClassId", "3");
        paramMap.put("PageNo", "1");
        paramMap.put("Acct", "XRTEST");
        paramMap.put("QueryType", "0");
        paramMap.put("QueryFields", "FItemId,FNumber,FName,FEmpGroup,FEmpGroup_FName,FDepartmentID_FName,FDepartmentID,FGender,FGender_FName,FBirthDay,FDegree,FDegree_FName,FPhone,FMobilePhone,FID,FDuty,FDuty_FName,FHireDate,FLeaveDate,FNAME,FAddress,Fmail,FNote");
        KisApiResultVOS kisApiResultVOS = postRequest(redisUtil.get(Const.ERP_CONNECT_URL).toString() + "/api/ItemData", paramMap);
        String datas = kisApiResultVOS.getDatas();
        List<KisUserDto> kisUserDtos = JSON.parseArray(datas, KisUserDto.class);
        List<SysUser> sysUsers = kisUserDtos.stream().map(KisUserDto::voToPo).collect(Collectors.toList());
        List<KisClerkDto> kisClerkDtos = this.clerkSync();
        Map<String, Integer> kisClerkDtosMap = kisClerkDtos.stream().collect(Collectors.toMap(item -> item.getFName(), item -> item.getFUserId(), (v1, v2) -> v1));
        sysUsers.forEach(item -> {
            if(kisClerkDtosMap.containsKey(item.getRealName())) item.setClerkId(kisClerkDtosMap.get(item.getRealName()));
        });
        return sysUsers;
    }
    public List<KisClerkDto> clerkSync() {
        HashMap<String, Object> paramMap = new HashMap<>();
        paramMap.put("Acct", "XRTEST");
        KisApiResultVOS kisApiResultVOS = postRequest(redisUtil.get(Const.ERP_CONNECT_URL).toString() + "/api/getuser", paramMap);
        String datas = kisApiResultVOS.getDatas();
        List<KisClerkDto> kisClerkDtos = JSON.parseArray(datas, KisClerkDto.class);
        return kisClerkDtos;
    }

    @Override
    public List<SysClient> clientSync() {
        HashMap<String, Object> paramMap = new HashMap<>();
        // {
        //     "PageSize": "5000",
        //         "Filter": "",
        //         "ItemClassId": "1",
        //         "PageNo": "1",
        //         "Acct": "Acct",
        //         "QueryType": "0",
        //         "QueryFields": "FItemId,FNumber,FName,FHelpCode,FShortName,FAddress,FStatus,FStatus_FName,FRegionID_FName,FRegionID,FTrade,FTrade_FName,FContact,FPhone,FMobilePhone,FPostalCode,FEmail,FBank,FAccount,Fcorperate,FTypeID,FTypeID_FName"
        // }
        paramMap.put("PageSize","5000");
        paramMap.put("Filter","");
        paramMap.put("ItemClassId","1");
        paramMap.put("PageNo","1");
        paramMap.put("Acct","XRTEST");
        paramMap.put("QueryType","0");
        paramMap.put("QueryFields","FItemId,FNumber,FName,FHelpCode,FShortName,FAddress,FStatus,FStatus_FName,FRegionID_FName,FRegionID,FTrade,FTrade_FName,FContact,FPhone,FMobilePhone,FPostalCode,FEmail,FBank,FAccount,Fcorperate,FTypeID,FTypeID_FName");

        KisApiResultVOS kisApiResultVOS = postRequest(redisUtil.get(Const.ERP_CONNECT_URL).toString() + "/api/ItemData", paramMap);
        String datas = kisApiResultVOS.getDatas();
        List<KisClientDto> kisClientDtos = JSON.parseArray(datas, KisClientDto.class);
        List<SysClient> sysClients = kisClientDtos.stream().map(item -> item.voToPo(item)).collect(Collectors.toList());
        return sysClients;
    }

    @Override
    public List<SysSupplier> supplierSync() {
        HashMap<String, Object> paramMap = new HashMap<>();
        // {
        //     "PageSize": "5000",
        //         "Filter": "",
        //         "ItemClassId": "8",
        //         "PageNo": "1",
        //         "Acct": "XRTEST",
        //         "QueryType": "0",
        //         "QueryFields": "FItemId,FNumber,FName,FHelpCode,FShortName,FAddress,FStatus,FStatus_FName,FContact,FPhone,FMobilePhone,FFax,FEmail,FBank,FAccount,Fcorperate,FDiscount,FTypeID,FTypeID_FName"
        // }
        paramMap.put("PageSize","5000");
        paramMap.put("Filter","");
        paramMap.put("ItemClassId","8");
        paramMap.put("PageNo","1");
        paramMap.put("Acct","XRTEST");
        paramMap.put("QueryType","0");
        paramMap.put("QueryFields","FItemId,FNumber,FName,FHelpCode,FShortName,FAddress,FStatus,FStatus_FName,FContact,FPhone,FMobilePhone,FFax,FEmail,FBank,FAccount,Fcorperate,FDiscount,FTypeID,FTypeID_FName");
        KisApiResultVOS kisApiResultVOS = postRequest(redisUtil.get(Const.ERP_CONNECT_URL).toString() + "/api/ItemData", paramMap);
        String datas = kisApiResultVOS.getDatas();
        List<KisSupplierDto> kisSupplierDtos = JSON.parseArray(datas, KisSupplierDto.class);
        List<SysSupplier> sysDepts = kisSupplierDtos.stream().map(item -> item.voToPo(item)).collect(Collectors.toList());
        return sysDepts;
    }

    @Override
    public List<SysDept> departSync() {
        HashMap<String, Object> paramMap = new HashMap<>();
//        paramMap.put("processId", 147);
        paramMap.put("PageSize","5000");
        paramMap.put("Filter","");
        paramMap.put("ItemClassId","2");
        paramMap.put("PageNo","1");
        paramMap.put("Acct","XRTEST");
        paramMap.put("QueryType","0");
        paramMap.put("QueryFields","FItemId,FNumber,FName,FHelpCode,FShortName,FAddress,FStatus,FStatus_FName,FContact,FPhone,FMobilePhone,FFax,FEmail,FBank,FAccount,Fcorperate,FDiscount,FTypeID,FTypeID_FName");
        KisApiResultVOS kisApiResultVOS = postRequest(redisUtil.get(Const.ERP_CONNECT_URL).toString() + "/api/ItemData", paramMap);
        String datas = kisApiResultVOS.getDatas();
        List<KisDepartDto> kisDepartDtos = JSON.parseArray(datas, KisDepartDto.class);
        List<SysDept> sysDepts = kisDepartDtos.stream().map(item -> item.voToPo(item)).collect(Collectors.toList());
        return sysDepts;
    }

    public KisApiResultVOS postRequest(String url, HashMap<String, Object> paramMap) {
        String result = HttpRequest.post(url)
                .header(Header.CONTENT_TYPE, "application/json; charset=utf-8")// 头信息，多个头信息多次调用此方法即可
                .header(Header.ACCEPT, "application/json")// 头信息，多个头信息多次调用此方法即可
                // .form(paramMap)//表单内容
                .body(JSON.toJSONString(paramMap))
                .timeout(20000)// 超时，毫秒
                .execute().body();
        KisApiResultVOS apiResultVOS = JSON.parseObject(JSON.parseObject(result, String.class), KisApiResultVOS.class);
        // 0 为正常  1 异常
        if (ObjectUtil.isEmpty(apiResultVOS.getStatus()) || !apiResultVOS.getStatus().equals(0)) {
            log.info("---返回数据：" + JSON.toJSONString(result));
            throw new BDException("同步失败，请联系管理员！");
        }
        return apiResultVOS;
    }

}
